package butines.kraz.state;

import butines.core.SpriteSheet;
import butines.kraz.entity.AbstractState;
import butines.kraz.entity.Corpse;

public class CorpseState extends AbstractState<Corpse> {

	private static final CorpseState instance = new CorpseState();
	
	public static CorpseState getInstance() {
		return instance;
	}
	
	@Override
	public void enter(Corpse owner) {
		SpriteSheet sheet = owner.getDead().getSheetUnit();
		owner.getSprite().setSheet(sheet);
		owner.getSprite().play("dead");
	}

	@Override
	public void leave(Corpse owner) {
		
	}

	@Override
	public void execute(Corpse owner) {
		if (owner.getSprite().isPlayed("dead")) {
			owner.changeState(CorpseDecayState.getInstance());
		}
	}
	
}
